$(document).ready(function() {
    $("#act_premium").click(function(){
        activatePremium();
    });
    
    $("#openAddExpire").click(function(){
        $("#normalExpire").hide();
        $("#addExpire").show();
        $("#openAddExpire").hide();
    });
});


function activatePremium() {
    var membership = $("#membership").val();
    var expire = $("#expire").val();
    $("#imgLoad").show();
    if (membership.lenght == 0 || membership.lenght < 0) {
        $("#act_premium").attr("disabled", true);
    }
    if (expire.lenght == 0 || expire.lenght < 0) {
        $("#act_premium").attr("disabled", true);
    }
    $("#act_premium").hide();
    $("#work").show();
    
    $.ajax({
        type: "POST",
        url: "ajax.php",
        data: {
            'membership' : membership,
            'expire' : expire,
            'act_premium' : 'act_premium'
        },
        success: function(msg) {
            $("#showMessageAct").html(msg);
            $("#imgLoad").hide();
            $("#work").hide();
            $("#donework").show();
        }
    });
    
   
   
}